$('.topbar-nav-right').hover(function () {
	$('.two-row-right').slideToggle(150)
})

$('.two-row-ul-li').hover(function() {
				$('.three-row').css("display", "block");
				var t = $(this).index();
				$('.three-row ul').eq(t).css("display", "block");
			}, function() {
				$('.three-row').css("display", "none");
				var t = $(this).index();
				$('.three-row ul').eq(t).css("display", "none");
			});
			
$('.three-row1').hover(function() {
				$('.three-row').css("display", "block");
				var t = $(this).index();
				console.log(t)
				$(this).css("display", "block");
			}, function() {
				$('.three-row').css("display", "none");
				var t = $(this).index();
				$(this).css("display", "none");
			});
			
$(function () {
	
	// 记录图片的索引，初始是第一张
	var index = 0;
	
	// 自动播放图片
	var timer = setInterval(nextImg,5000);
	
	// 下一张图
	function nextImg() {
		index = index==$('.carousel .pic a').length-1 ? 0 : index+1;
		showImg();
	}
	// 上一张图
	function prevImg() {
		index = index==0 ? $('.carousel .pic a').length-1 : index-1;
		showImg();
	}
	
	function showImg() {
		$('.carousel .pic a')
			.eq(index).show()
			.siblings().hide();
		$('.carousel .indicator span').eq(index)
				.addClass('active')
				.siblings().removeClass('active')
	}
	
	// 手动切换
	$('.carousel .indicator span').hover(function () {
		clearInterval(timer);
		index = $(this).index();
		showImg();
	},function () {
		timer = setInterval(nextImg,5000);
	});
	
	// 点击切换上一张/下一张
	$('.page span').hover(function () {
		clearInterval(timer);
		
	},function () {
		timer = setInterval(nextImg,5000);
	});
	// 上一张
	$('.carousel .page .prev').click(function () {
		prevImg();
	});
	// 下一张
	$('.carousel .page .next').click(function () {
		console.log(index);
		nextImg();
	});
	
});
